import { S } from '../../s';
import { IPSPanelItem } from './ipspanel-item';
import { IPSSysPanelTabPage } from './ipssys-panel-tab-page';
import { PSSysPanelContainerImplBase } from './pssys-panel-container-impl-base';

export class PSSysPanelTabPageImpl
  extends PSSysPanelContainerImplBase
  implements IPSSysPanelTabPage
{
  get captionItemName(): string {
    return this.M.captionItemName;
  }

  protected pspanelitems: IPSPanelItem[];
  getPSPanelItems(): IPSPanelItem[] | null {
    return (
      this.pspanelitems ||
      (this.pspanelitems = this.fillChildListModel(
        this.M.getPSPanelItems,
        S._17c,
      ) as IPSPanelItem[])
    );
  }

  findPSPanelItem(objKey: any): IPSPanelItem | null {
    return this.getPSModel5(
      S._17c,
      this.getPSPanelItems(),
      objKey,
    ) as IPSPanelItem;
  }

  get predefinedType(): string {
    return this.M.predefinedType;
  }

  get titleBarCloseMode(): 0 | 1 | 2 {
    return this.M.titleBarCloseMode != null ? this.M.titleBarCloseMode : 0;
  }
  get cls(): string {
    return 'PSSysPanelTabPageImpl';
  }
  instanceof(cls: string): boolean {
    if (
      cls == S._3f7 ||
      cls == S._ac ||
      cls == S._180 ||
      cls == S._17c ||
      cls == S._190 ||
      cls == S._17d ||
      cls == S._191
    )
      return true;
    return super.instanceof(cls);
  }
}
